package com.digtime.abstractfactory;

import com.digtime.abstractfactory.impl.Green;
import com.digtime.abstractfactory.impl.Red;

/**
 * @author: kaiyi
 * @Date 2020/11/22 11:20
 */
public class ColorFactory extends AbstractFactory {
    @Override
    public Color getColor(String color) {
        if(color == null){
            return null;
        }

        if(color.equalsIgnoreCase("GREEN")){
            return new Green();
        }else if(color.equalsIgnoreCase("RED")){
            return new Red();
        }

        return null;
    }

    @Override
    public Shape getShape(String shapeType) {
        return null;
    }
}
